package com.designmodel.atcion.iterator;

/**
 * 具体容器
 *
 * @author think
 * @version 1.0.0
 * @since 2020/4/22
 */
public class MyCollection implements Collection {

    public String[] string = {"A", "B", "C", "D", "E"};

    @Override
    public Iterator iterator() {
        return new MyIterator(this);
    }

    @Override
    public Object get(int i) {
        return string[i];
    }

    @Override
    public int size() {
        return string.length;
    }
}
